///@file PCbasis.h
///@brief Declaration of a polynomial chaos basis
///@author Arnaud Duval
///@version 0.0
///@date 2010/05/10


#ifndef PCBASIS_H
#define PCBASIS_H

#include "../../mathobject/include/Polynomial.h"
#include "../../mathobject/include/Vector.h"
#include "IndexSet.h"


///@class PCbasis
///@brief Class defining an polynomial chaos basis
class PCbasis
{
	private:
		///@brief Number of variables
		unsigned int M;
		///@brief Cardinality of basis
		unsigned int P;
		///@brief Array of polynomials
		Polynomial **poly;
		///@brief Set of indices defining the polynomial chaos basis
		IndexSet idx;
	public:
		///@brief Default constructor
		PCbasis();
		///@brief Constructor with arguments
		PCbasis(unsigned int, std::string*, unsigned int);
		///@brief Copy constructor
		PCbasis(const PCbasis&);
		///@brief Copy constructor from temporary object
		PCbasis(PCbasis*);
		///@brief Constructor with truncation from an existing basis
		PCbasis(const PCbasis&, unsigned int);
		///@brief Constructor with a given IndexSet
		PCbasis(IndexSet, std::string*);
		///@brief Destructor
		~PCbasis();
		///@brief Overload of = operator
		PCbasis& operator=(const PCbasis&);
		///@brief Overload of = operator for temporary object
		PCbasis& operator=(PCbasis*);
		///@brief Return PCbasis cardinality
		unsigned int Cardinality();
		///@brief Compute value with a given variables vector
		Vector Evaluate(Vector x);
		///@brief Return IndexSet used for PC basis
		IndexSet A();
		///@brief Return number of variables
		unsigned int _M();

		///@brief Overload of << operator
		friend std::ostream& operator<<(std::ostream &, const PCbasis&);
};


#endif
